home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 51 / 051.d81 / windows demo (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  205 lines

  1. 10 ifa=.thena=1:load"windows.o",8,1
  2. 15 poke55,.:poke56,64:clr
  3. 20 dim fr(200),fc(200),tr(200),tc(200)
  4. 25 ad=16384:goto1000
  5. 30 :
  6. 50 sys 52496,fr,fc,tr,tc,ad,fu,co,rv
  7. 55 ad=ad+(tr-fr+1)*(tc-fc+1)*2:n=n+1
  8. 60 fr(n)=fr:fc(n)=fc:tr(n)=tr:tc(n)=tc
  9. 65 return
  10. 66 :
  11. 70 fr=fr(n):fc=fc(n):tr=tr(n):tc=tc(n)
  12. 75 ad=ad-(tr-fr+1)*(tc-fc+1)*2:n=n-1
  13. 80 sys 52496,fr,fc,tr,tc,ad,8,1,1
  14. 85 return
  15. 86 :
  16. 90 c(1)=1:c(2)=15:c(3)=12:c(4)=11:
  17. 91 fora=1to4
  18. 92 sys 52496,2,2,22,37,.,4,c(a),.
  19. 93 next:return
  20. 94 :
  21. 95 c(1)=1:c(2)=15:c(3)=12:c(4)=11:
  22. 96 fora=4to1step-1
  23. 97 sys 52496,2,2,22,37,.,4,c(a),.
  24. 98 next:return
  25. 99 :
  26. 1000 poke53280,.:poke53281,.:printchr$(142)"[147][151]";
  27. 1010 fora=1to124:print"loadstar";:next:print"loadstr[157][148]a"
  28. 1020 fora=217to242:pokea,peek(a)or128:next
  29. 1030 fr=1:fc=8:tr=5:tc=31:fu=7:co=1:         rv=2:gosub 50
  30. 1040 print"loadstar presents:"
  31. 1050 fr=8:fc=4:tr=16:tc=35:rv=14:            gosub50
  32. 1060 print"[154]           windows"
  33. 1070 print"[154]        by mike maynard"
  34. 1080 print"[154]       (c)opyright  1988"
  35. 1090 fr=19:fc=5:tr=23:tc=34:rv=5:            gosub 50
  36. 1100 print"press space to continue.":poke198,.
  37. 1110 ifpeek(203)<>60then1110
  38. 1120 fora=1to3:gosub70:next
  39. 1130 fr=2:fc=2:tr=22:tc=37:rv=.:gosub50
  40. 1140 print"windows is a machine language "
  41. 1150 print"routine that can save, clear, "
  42. 1160 print"and put a border around a     "
  43. 1170 print"rectangular area of the screen."
  44. 1180 print"it also lets you restore an   "
  45. 1190 print"area that has been saved.     "
  46. 1200 print"the following is the syntax:  "
  47. 1210 print"[158]sys wi,fr,fc,tr,tc,ad,fu,co,rv"
  48. 1220 print"wi will always be 52496. this"
  49. 1230 print"is where the machine language"
  50. 1240 print"is located in memory."
  51. 1250 print"   [159]press space to continue":poke198,.
  52. 1260 ifpeek(203)<>60then1260
  53. 1270 gosub90:gosub70
  54. 1280 fr=2:fc=2:tr=22:tc=37:rv=.:gosub50
  55. 1290 print"[158]sys wi,ur,uc,lr,lc,ad,fu,co,rv"
  56. 1300 print"ur is the upper left row"
  57. 1310 print"number. (0 - 24)"
  58. 1320 print"[158]uc is the upper left column"
  59. 1330 print"number. (0 - 39)
  60. 1340 [153]"syslr is the lower right row"
  61. 1350 [153]"number. (ur - 24)
  62. 1360 print"[158]lc is the lower right column"
  63. 1370 print"number. (uc - 39)
  64. 1380 [153]"   openpress space to continue":[151]198,.
  65. 1390 [139][194](203)[179][177]60[167]1390
  66. 1400 [141]90:[141]70
  67. 1405 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
  68. 1410 [153]"syssys wi,ur,uc,lr,lc,ad,fu,co,rv"
  69. 1420 [153]"ad is the address where you"
  70. 1430 [153]"want the window data stored."
  71. 1440 [153]"note you can store data in the"
  72. 1450 [153]"ram under basic rom at"
  73. 1460 [153]"addresses 40960 - 49151."
  74. 1470 [153]"you can find the next available"
  75. 1480 [153]"address for storing a window"
  76. 1490 [153]"by using the following formula:"
  77. 1500 [153]"  sysad=(lr-ur+1)*(lc-uc+1)*2"
  78. 1510 [153]"this formula comes in handy"
  79. 1520 [153]"when you wish to save multiple"
  80. 1530 [153]"windows in a 'window area'."
  81. 1540 [153]"   openpress space to continue":[151]198,.
  82. 1550 [139][194](203)[179][177]60[167]1550
  83. 1560 [141]90:[141]70
  84. 1570 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
  85. 1580 [153]"syssys wi,ur,uc,lr,lc,ad,fu,co,rv"
  86. 1590 [153]"sysfu is the function that the"
  87. 1600 [153]"window will perform and is"
  88. 1610 [153]"as follows:"
  89. 1630 [153]"bits   value   what it does"
  90. 1640 [153]"----   -----   ------------"
  91. 1650 [153]" 0        1    save window"
  92. 1660 [153]" 1        2    clear window"
  93. 1670 [153]" 2        4    border window"
  94. 1680 [153]" 3        8    restore window"
  95. 1690 [153]" 4       16    change color"
  96. 1700 [153]" 5       32    /unused/"
  97. 1710 [153]" 6       64    /unused/"
  98. 1720 [153]" 7      128    /unused/"
  99. 1730 [153]"   openpress space to continue":[151]198,.
  100. 1740 [139][194](203)[179][177]60[167]1740
  101. 1750 [141]90:[141]70
  102. 1760 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
  103. 1770 [153]"syssys wi,ur,uc,lr,lc,ad,fu,co,rv"
  104. 1780 [153]"co is the border color and"
  105. 1790 [153]"is only used when bit 2 of the"
  106. 1800 [153]"function is set."
  107. 1810 [153]"sysrv will fill the window"
  108. 1820 [153]"with a space (if it's zero)"
  109. 1830 [153]"or a reversed space (if it's"
  110. 1840 [153]"a non-zero number). if a"
  111. 1850 [153]"non-zero number is used, the"
  112. 1860 [153]"window will be reversed in the"
  113. 1870 [153]"color that corresponds to"
  114. 1880 [153]"the number used."
  115. 1890 [153]"   openpress space to continue":[151]198,.
  116. 1900 [139][194](203)[179][177]60[167]1900
  117. 1910 [141]90:[141]70
  118. 1920 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
  119. 1930 [153]"syssys wi,ur,uc,lr,lc,ad,fu,co,rv"
  120. 1940 [153]"finally, the last feature,"
  121. 1950 [153]"not shown above, is optional."
  122. 1960 [153]"it lets you change the color"
  123. 1970 [153]"of the window area to any of"
  124. 1980 [153]"the 16 colors by wiping the"
  125. 1990 [153]"color memory area."
  126. 2000 [153]"to use this optional feature,"
  127. 2010 [153]"add sys,tc to the end of the"
  128. 2020 [153]"syssys statement; where systc is"
  129. 2030 [153]"the color you want the windowed"
  130. 2040 [153]"area to become."
  131. 2050 [153]"   openpress space to continue":[151]198,.
  132. 2060 [139][194](203)[179][177]60[167]2060
  133. 2070 [141]90:[141]70
  134. 2080 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
  135. 2090 [153]"sys  windows    by mike maynard"
  136. 2100 [153]"for a more in-depth article"
  137. 2110 [153]"on the window routine, choose"
  138. 2120 [153]"'read it' from the loadstar"
  139. 2125 [153]"menu."
  140. 2130 [153]"    1cont) re-read window docs"
  141. 2140 [153]"    2cont) multi-windows demo"
  142. 2150 [153]"    3cont) pull-down menus demo"
  143. 2160 [153]"    4cont) return to loadstar"
  144. 2170 [153]"     contchoose 1cont, 2cont, 3cont or 4cont.    "
  145. 2180 [161]a$:[139]a$[178]""[167]2180
  146. 2190 a[178][197](a$):[139]a[179]1[176]a[177]4[167]2180
  147. 2195 [145] a [137] 6000,3000,4000,5000
  148. 3000 [153]"on  creating multiple windows!"
  149. 3010 fr[178][181]([187](.)[172]10)
  150. 3020 fc[178][181]([187](.)[172]17)
  151. 3030 tr[178][181]([187](.)[172]13)[170]fr[170]3
  152. 3040 tc[178][181]([187](.)[172]20)[170]fc[170]3
  153. 3050 co[178][181]([187](.)[172]15)[170]1
  154. 3060 rv[178][181]([187](.)[172]15)[170]1
  155. 3070 fu[178]7:[141]50
  156. 3080 [139]ad[179]49152[167]3010
  157. 3090 fr[178]19:fc[178].:tr[178]24:tc[178]39:fu[178]7:co[178]1:       a[178]ad:ad[178]50496:rv[178]14:[141]50
  158. 3100 [153]"cont      "n"windows were created!!"
  159. 3110 [153]" press any key to restore all windows"
  160. 3120 [151]198,.:[146]198,1
  161. 3130 [141]70:ad[178]a
  162. 3140 [129]b[178]1[164]n[171]1:[141]70:[130]
  163. 3150 [129]z[178]1[164]4:[141]90:[141]95:[130]
  164. 3250 [153]"";:[137]2170
  165. 4000 [153]"on  ^^^      look up!      ^^^"
  166. 4010 [153]"  tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab("
  167. 4020 fr[178].:fc[178].:tr[178]2:tc[178]39:co[178]6:rv[178]1:[141]50
  168. 4030 [153]" menu 1    menu 2    menu 3    menu 4"
  169. 4040 [129]l1[178]1000[164][171]400[169][171]200
  170. 4050 [129]l2[178]1[164]4
  171. 4060 [145] l2 [141] 4500,4600,4700,4800
  172. 4070 [129]l3[178]1[164]l1:[130]:[141]70
  173. 4080 [130]:[130]:[141]70
  174. 4090 [153]"                              ononon"
  175. 4095 [137]2170
  176. 4500 tr[178][181]([187](.)[172]16)[170]4
  177. 4505 fr[178]2:fc[178].:tc[178]9:co[178]6:rv[178]1:[141]50
  178. 4510 [153]""
  179. 4520 [129]a[178]1[164]tr[171]fr[171]1:[153][163]1)"item"a:[130]
  180. 4530 [142]
  181. 4600 tr[178][181]([187](.)[172]16)[170]4
  182. 4605 fr[178]2:fc[178]10:tc[178]19:co[178]6:rv[178]1:[141]50
  183. 4610 [153]""
  184. 4620 [129]a[178]1[164]tr[171]fr[171]1:[153][163]11)"item"a:[130]
  185. 4630 [142]
  186. 4700 tr[178][181]([187](.)[172]16)[170]4
  187. 4705 fr[178]2:fc[178]20:tr[178]12:tc[178]29:co[178]6:rv[178]1:[141]50
  188. 4710 [153]""
  189. 4720 [129]a[178]1[164]tr[171]fr[171]1:[153][163]21)"item"a:[130]
  190. 4730 [142]
  191. 4800 tr[178][181]([187](.)[172]16)[170]4
  192. 4805 fr[178]2:fc[178]30:tr[178]